/*
 * glchecker.h
 *
 *  Created on: 28.06.2011
 *      Author: marcell
 */

#ifndef __GLCHECKER_H__
#define __GLCHECKER_H__

#include <GL/glew.h>
#include <GL/gl.h>
#include <stdio.h>

#define OPENGL_VERSION(major, minor) ((((major) & 0x0000ffff) << 16) | ((minor) & 0x0000ffff))

unsigned get_opengl_major_version ()
{
	const GLubyte* str = glGetString(GL_VERSION);
	int vMajor, vMinor;
	sscanf((const char*)str, "%d.%d", &vMajor, &vMinor);
	
	return OPENGL_VERSION(vMajor, vMinor);
}



#endif /* ! __GLCHECKER_H__ */
